package com.alibaba.dubbo.demo.provider;

import com.alibaba.dubbo.demo.DemoService;

public class DemoServiceAop implements DemoService {

    private Car car;

    private DemoService demoService;


    /**
     * dubbo的aop,被代理的对象,必须用构造函数注入数据,
     * 在com.alibaba.dubbo.common.extension.ExtensionLoader#loadFile(java.util.Map, java.lang.String)
     * 中通过     clazz.getConstructor(type);来判断是否成功,如果成功,说明是aop代理类
     * @param demoService
     */
    public DemoServiceAop(DemoService demoService) {
        this.demoService = demoService;
    }

    @Override
    public String sayHello(String name) {

        System.out.println("aop.............开始");
        String aop = demoService.sayHello(name);
        System.out.println("aop.............结束");
        return aop;
    }
}
